package com.atguigu.demo.gmall.controller;

import com.atguigu.demo.gmall.bean.CartInfo;
import com.atguigu.demo.gmall.service.CartInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 购物车表 用户登录系统时更新冗余 前端控制器
 * </p>
 *
 * @author zhangchen
 * @since 2024-11-19
 */
@RestController
@RequestMapping("/gmall/cartInfo")
public class CartInfoController {

    @Autowired
    CartInfoService cartInfoService;

    @PostMapping("/cart")
    public String saveCartInfo(@RequestBody CartInfo cartInfo){
        cartInfoService.saveOrUpdate(cartInfo);
        return "success";
    }

}
